<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/views/common/includetag.jsp"%>
<!DOCTYPE html>
<html lang="en_US">
    <head>
        <title><spring:message code="app.batch.title" /></title>
        <link rel="stylesheet" type="text/css" href="${ctx}/assets/jqueryplugin/jquery-validation/css/jquery.validate.css" />
        <link rel="stylesheet" type="text/css" href="${ctx}/assets/bootstrap/bootstrap-datepicker/css/datepicker.css" />
        <script type="text/javascript" src="${ctx}/assets/bootstrap/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
		<script type="text/javascript" src="${ctx}/assets/bootstrap/bootstrap-datepicker/js/locales/bootstrap-datepicker.zh-CN.js"></script>
        <script type="text/javascript" src="${ctx}/static/js/manage/batch/list.js"></script>
        <style type="text/css">
        	.input-group-addon {
			    width: 84px;
			    line-height: 20px;
			    height: 34px;
			    font-size: 12px;
			}
			.input-group {
			    position: relative;
			    display: inline-flex !important;
			    border-collapse: separate;
			    width: 360px;
			    margin-bottom: 5px;
			    line-height: 30px;
			    height: 34px;
			}
			.searchBtn {
			    height: 32px;
			    margin-bottom: 6px;
			}
        </style>
    </head>
    <body>
        <div class="clearfix"></div>
		<div class="row back-top-title">
			<div class="col-md-12">
				<span><spring:message code="app.batch.title" /></span>
			</div>
		</div>
		
       	<div class="row">
			<div class="col-md-12">
				<div class="panel panel-white">
					<div class="panel-body">
						<form style="position:relative" id="splitPage" action="${ctx}/manage/batch" method="POST" role="form" class="form-horizontal">  
							<!-- search part -->
							<div id="toolbar" class="panel panel-default" style="margin:-5 0 -5 0;padding:0 0 0 0;">
								<div class="panel-body">
									<div class="form-inline" role="form">
										<div class="form-inline form-group">
											<div class="input-group" style="width: 230px;margin-bottom: 5px;">
												<span class="input-group-addon"><spring:message code="app.batch.title.mc" /></span>
												<input type="text" class="form-control" placeholder="请输入批次名称" name="query_mc" value="${query_mc}"
													onkeyup="value=value.replace(/[.~!@#$%\^\+\*&\\\/\?\|:\.{}()\';=]/g,'')" 
													onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[.~!@#$%\^\+\*&\\\/\?\|:\.{}()';=]/g,''))"
													style="width:150px;margin-right: 5px;">
											</div>
											<div class="input-group" style="width: 230px;margin-bottom: 5px;">
												<span class="input-group-addon"><spring:message code="app.batch.title.sfsy" /></span>
												<select name="query_sfsy" class="form-control" style="width:150px;margin-right: 10px;">
													<option value="">---请选择---</option>
													<c:forEach var="item" items="${sfsys}">
														<option value="${item.code}" <c:if test="${query_sfsy==item.code}">selected="selected"</c:if>>${item.name}</option>
													</c:forEach>
												</select>
											</div>	
											<div class="input-group" style="width: 340px;margin-bottom: 5px;">	
												<span class="input-group-addon"><spring:message code="app.batch.title.ksrq" /></span>
												<div class="input-append date" id="query_ksrq" data-date="" data-date-format="yyyy-mm-dd" style="width: 120px;margin-bottom: -35px;">
													<input type="text" size="16" name="query_ksrq" class="form-control" style="width: 120px;"
														value="<c:if test="${not empty query_ksrq}"><fmt:formatDate value="${query_ksrq}" pattern="yyyy-MM-dd"/></c:if>">
												    <span class="add-on"><i class="icon-th"></i></span>
												</div>
												<span style="margin: 0 5px;">至</span>
												<div class="input-append date" id="query_jsrq" data-date="" data-date-format="yyyy-mm-dd" style="width: 120px;margin-bottom: -35px;">
													<input type="text" size="16" name="query_ksrq" class="form-control" style="width: 120px;"
														value="<c:if test="${not empty query_ksrq}"><fmt:formatDate value="${query_jsrq}" pattern="yyyy-MM-dd"/></c:if>">
												    <span class="add-on"><i class="icon-th"></i></span>
												</div>
											</div>	
											<button type="submit" class="fa fa-search btn btn-warning searchBtn">查询</button>
										</div>
									</div>
							  	</div>
							  	<!-- buttons part -->
							  	<div class="row">
									<div class="col-md-12 space20">
										<a href="#none" class="btn btn-primary btn-add">
											<i class="fa fa-plus"></i>
											<spring:message code="app.common.action.add" />
										</a>
									</div>
								</div>
							</div>
							<!-- table part -->
							<table id="dataTable" class="table table-striped table-bordered table-hover table-full-width">
	                            <thead>
	                                <tr>
	                                    <th><spring:message code="app.common.title.serial" /></th>
	                                    <th><spring:message code="app.batch.title.mc" /></th>
	                                    <th><spring:message code="app.batch.title.ksrq" /></th>
	                                    <th><spring:message code="app.batch.title.jsrq" /></th>
	                                    <th><spring:message code="app.batch.title.sfsy" /></th>
	                                    <th><spring:message code="app.batch.title.xxmc" /></th>
	                                    <th><spring:message code="app.common.action.operate" /></th>
	                                </tr>
	                            </thead>
	                            <tbody>
	                                <c:forEach items="${pagination.datas}" var="entity" varStatus="s">
	                                    <tr data-id="${entity.id}">
	                                        <td><c:out value="${s.index + 1}" /></td>
	                                        <td><c:out value="${entity.mc}" /></td>
	                                        <td><fmt:formatDate value="${entity.ksrq}" pattern="yyyy-MM-dd"/></td>
	                                        <td><fmt:formatDate value="${entity.jsrq}" pattern="yyyy-MM-dd"/></td>
	                                        <td><c:out value="${entity.sfsyName}" /></td>
	                                        <td><c:out value="${entity.schoolCode}" /></td>
	                                        <td>
	                                            <a href="${ctx}/manage/batch/edit?id=${entity.id}" class="btn btn-info btn-sm"><spring:message code="app.common.action.edit" /></a>
	                                            <a href="#none" class="btn btn-danger btn-sm btn-delete"><spring:message code="app.common.action.delete" /></a>
	                                        </td>
	                                    </tr>
	                                </c:forEach>
	                            </tbody>
	                        </table>
	                        <div class="row" id="splitPageDiv">
								<jsp:include page="/views/common/splitPage.jsp">
									<jsp:param value="mainPanel" name="divId"/>
									<jsp:param value="splitPage" name="formId"/>
									<jsp:param value="splitPageDiv" name="splitPageDiv"/>
								</jsp:include>
							</div>
						</form>
				    </div>
				</div>
			</div>
		</div>
    </body>
</html>